home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / rfc / rfc1506 < prev    next >
Text File  |  1993-09-17  |  86KB  |  2,188 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                      J. Houttuin
  8. Request for Comments:  1506                           RARE Secretariat
  9. RARE Technical Report: 6                                   August 1993
  10.  
  11.  
  12.         A Tutorial on Gatewaying between X.400 and Internet Mail
  13.  
  14. Status of this Memo
  15.  
  16.    This memo provides information for the Internet community.  It does
  17.    not specify an Internet standard.  Distribution of this memo is
  18.    unlimited.
  19.  
  20. Introduction
  21.  
  22.    There are many ways in which X.400 and Internet (STD 11, RFC 822)
  23.    mail systems can be interconnected. Addresses and service elements
  24.    can be mapped onto each other in different ways. From the early
  25.    available gateway implementations, one was not necessarily better
  26.    than another, but the sole fact that each handled the mappings in a
  27.    different way led to major interworking problems, especially when a
  28.    message (or address) crossed more than one gateway. The need for one
  29.    global standard on how to implement X.400 - Internet mail gatewaying
  30.    was satisfied by the Internet Request For Comments 1327, titled
  31.    "Mapping between X.400(1988)/ISO 10021 and RFC 822."
  32.  
  33.    This tutorial was produced especially to help new gateway managers
  34.    find their way into the complicated subject of mail gatewaying
  35.    according to RFC 1327. The need for such a tutorial can be
  36.    illustrated by quoting the following discouraging paragraph from RFC
  37.    1327, chapter 1: "Warning: the remainder of this specification is
  38.    technically detailed. It will not make sense, except in the context
  39.    of RFC 822 and X.400 (1988). Do not attempt to read this document
  40.    unless you are familiar with these specifications."
  41.  
  42.    The introduction of this tutorial is general enough to be read not
  43.    only by gateway managers, but also by e-mail managers who are new to
  44.    gatewaying or to one of the two e-mail worlds in general. Parts of
  45.    this introduction can be skipped as needed.
  46.  
  47.    For novice end-users, even this tutorial will be difficult to read.
  48.    They are encouraged to use the COSINE MHS pocket user guide [14]
  49.    instead.
  50.  
  51.    To a certain extent, this document can also be used as a reference
  52.    guide to X.400 <-> RFC 822 gatewaying. Wherever there is a lack of
  53.    detail in the tutorial, it will at least point to the corresponding
  54.    chapters in other documents. As such, it shields the RFC 1327 novice
  55.  
  56.  
  57.  
  58. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 1]
  59.  
  60. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  61.  
  62.  
  63.    from too much detail.
  64.  
  65. Acknowledgements
  66.  
  67.    This tutorial is heavily based on other documents, such as [2], [6],
  68.    [7], [8], and [11], from which large parts of text were reproduced
  69.    (slightly edited) by kind permission from the authors.
  70.  
  71.    The author would like to thank the following persons for their
  72.    thorough reviews: Peter Cowen (Nexor), Urs Eppenberger (SWITCH), Erik
  73.    Huizer (SURFnet), Steve Kille (ISODE Consortium), Paul Klarenberg
  74.    (NetConsult), Felix Kugler (SWITCH), Sabine Luethi.
  75.  
  76. Disclaimer
  77.  
  78.    This document is not everywhere exact and/or complete in describing
  79.    the involved standards. Irrelevant details are left out and some
  80.    concepts are simplified for the ease of understanding. For reference
  81.    purposes, always use the original documents.
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 2]
  115.  
  116. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  117.  
  118.  
  119. Table of Contents
  120.  
  121.        1. An overview of relevant standards ........................   4
  122.          1.1. What is X.400 ? ......................................   5
  123.          1.2. What is an RFC ? .....................................   8
  124.          1.3. What is RFC 822 ? ....................................   9
  125.          1.4. What is RFC 1327 ? ...................................  11
  126.        2. Service Elements .........................................  12
  127.        3. Address mapping ..........................................  14
  128.          3.1. X.400 addresses ......................................  15
  129.            3.1.1. Standard Attributes ..............................  15
  130.            3.1.2. Domain Defined Attributes ........................  17
  131.            3.1.3. X.400 address notation ...........................  17
  132.          3.2. RFC 822 addresses ....................................  19
  133.          3.3. RFC 1327 address mapping .............................  20
  134.            3.3.1. Default mapping ..................................  20
  135.              3.3.1.1. X.400 -> RFC 822 .............................  20
  136.              3.3.1.2. RFC 822 -> X.400 .............................  22
  137.            3.3.2. Exception mapping ................................  23
  138.              3.3.2.1. PersonalName and localpart mapping ...........  25
  139.              3.3.2.2. X.400 domain and domainpart mapping ..........  26
  140.                3.3.2.2.1. X.400 -> RFC 822 .........................  27
  141.                3.3.2.2.2. RFC 822 -> X.400 .........................  28
  142.          3.4. Table co-ordination ..................................  31
  143.          3.5. Local additions ......................................  31
  144.          3.6. Product specific formats .............................  32
  145.          3.7. Guidelines for mapping rule definition ...............  34
  146.        4. Conclusion ...............................................  35
  147.        Appendix A. References ......................................  36
  148.        Appendix B. Index  (Only available in the Postscript version)  37
  149.        Appendix C. Abbreviations ...................................  37
  150.        Appendix D. How to access the MHS Co-ordination Server ......  38
  151.        Security Considerations .....................................  39
  152.        Author's Address ............................................  39
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 3]
  171.  
  172. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  173.  
  174.  
  175. 1. An overview of relevant standards
  176.  
  177.    This chapter describes the history, status, future, and contents of
  178.    the involved standards.
  179.  
  180.    There is a major difference between mail systems used in the USA and
  181.    Europe. Mail systems originated mainly in the USA, where their
  182.    explosive growth started as early as in the seventies. Different
  183.    company-specific mail systems were developed simultaneously, which,
  184.    of course, led to a high degree of incompatibility. The Advanced
  185.    Research Projects Agency (ARPA), which had to use machines of many
  186.    different manufacturers, triggered the development of the Internet
  187.    and the TCP/IP protocol suite, which was later accepted as a standard
  188.    by the US Department of Defense (DoD). The Internet mail format is
  189.    defined in STD 11, RFC 822 and the protocol used for exchanging mail
  190.    is known as the simple mail transfer protocol (SMTP) [1]. Together
  191.    with UUCP and the BITNET protocol NJE, SMTP has become one of the
  192.    main de facto mail standards in the US.
  193.  
  194.    Unfortunately, all these protocols were incompatible, which explains
  195.    the need to come to an acceptable global mail standard.  CCITT and
  196.    ISO began working on a norm and their work converged in what is now
  197.    known as the X.400 Series Recommendations. One of the objectives was
  198.    to define a superset of the existing systems, allowing for easier
  199.    integration later on. Some typical positive features of X.400 are the
  200.    store-and-forward mechanism, the hierarchical address space and the
  201.    possibility of combining different types of body parts into one
  202.    message body.
  203.  
  204.    In Europe, the mail system boom came later. Since there was not much
  205.    equipment in place yet, it made sense to use X.400 as much as
  206.    possible right from the beginning. A strong X.400 lobby existed,
  207.    especially in West-Germany (DFN). In the R&D world, mostly EAN was
  208.    used because it was the only affordable X.400 product at that time
  209.    (Source-code licenses were free for academic institutions).
  210.  
  211.    At the moment, the two worlds of X.400 and SMTP are moving closer
  212.    together. For instance, the United States Department of Defense, one
  213.    of the early forces behind the Internet, has decided that future DoD
  214.    networking should be based on ISO standards, implying a migration
  215.    from SMTP to X.400. As an important example of harmonisation in the
  216.    other direction, X.400 users in Europe have a need to communicate
  217.    with the Internet. Due to the large traffic volume between the two
  218.    nets it is not enough interconnecting them with a single
  219.    international gateway.  The load on such a gateway would be too
  220.    heavy. Direct access using local gateways is more feasible.
  221.  
  222.    Although the expected success of X.400 has been a bit disappointing
  223.  
  224.  
  225.  
  226. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 4]
  227.  
  228. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  229.  
  230.  
  231.    (mainly because no good products were available), many still see the
  232.    future of e-mail systems in the context of this standard.
  233.  
  234.    And regardless if in the long run X.400 will or will not take over
  235.    the world of e-mail systems, SMTP cannot be neglected over the next
  236.    ten years. Especially the simple installation procedures and the high
  237.    degree of connectivity will contribute to a growing number of RFC 822
  238.    installations in Europe and world-wide in the near future.
  239.  
  240. 1.1. What is X.400 ?
  241.  
  242.    In October 1984, the Plenary Assembly of the CCITT accepted a
  243.    standard to facilitate international message exchange between
  244.    subscribers to computer based store-and-forward message services.
  245.    This standard is known as the CCITT X.400 series recommendations
  246.    ([16], from now on called X.400(84)) and happens to be the first
  247.    CCITT recommendation for a network application. It should be noted
  248.    that X.400(84) is based on work done in the IFIP Working Group 6.5,
  249.    and that ISO at the same time was proceeding towards a compatible
  250.    document. However, the standardisation efforts of CCITT and ISO did
  251.    not converge in time (not until the 1988 version), to allow the
  252.    publication of a common text.
  253.  
  254.    X.400(84) triggered the development of software implementing (parts
  255.    of) the standard in the laboratories of almost all major computer
  256.    vendors and many software houses. Similarly, public carriers in many
  257.    countries started to plan X.400(84) based message systems that would
  258.    be offered to the users as value added services. Early
  259.    implementations appeared shortly after first drafts of the standard
  260.    were published and a considerable number of commercial systems are
  261.    available nowadays.
  262.  
  263.    X.400(84) describes a functional model for a Message Handling System
  264.    (MHS) and associates services and protocols. The model illustrated in
  265.    Figure 1.1. defines the components of a distributed messaging system.
  266.  
  267.    Users in the MHS environment are provided with the capability of
  268.    sending and receiving messages. Users in the context of an MHS may be
  269.    humans or application processes. The User Agent (UA) is a process
  270.    that makes the services of the MTS available to the user. A UA may be
  271.    implemented as a computer program that provides utilities to create,
  272.    send, receive and perhaps archive messages. Each UA, and thus each
  273.    user, is identified by a name (each user has its own UA).
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 5]
  283.  
  284. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  285.  
  286.  
  287.     -----------------------------------------------------------------
  288.     |                user        user   Message Handling Environment|
  289.     |                 |            |                                |
  290.     |     ----------------------------------------------------------|
  291.     |     |           |            |    Message Handling System    ||
  292.     |     |         ----          ----                             ||
  293.     |     |         |UA|          |UA|                             ||
  294.     |     |         ----          ----                             ||
  295.     |     |           |             |                              ||
  296.     |     |       -------------------------------------------------||
  297.     |     |       |   |             |   Message Transfer System   |||
  298.     |     | ----  |  -----         -----                          |||
  299.     |user-|-|UA|--|--|MTA|         |MTA|                          |||
  300.     |     | ----  |  -----         -----                          |||
  301.     |     |       |    \             /                            |||
  302.     |     |       |     \           /                             |||
  303.     |     |       |      \         /                              |||
  304.     |     |       |       \       /                               |||
  305.     |     |       |        \     /                                |||
  306.     |     | ----  |         -----                                 |||
  307.     |user-|-|UA|--|---------|MTA|                                 |||
  308.     |     | ----  |         -----                                 |||
  309.     |     |       -------------------------------------------------||
  310.     |     ----------------------------------------------------------|
  311.     -----------------------------------------------------------------
  312.                     Fig. 1.1. X.400 functional model
  313.  
  314.    The Message Transfer system (MTS) transfers messages from an
  315.    originating UA to a recipient UA. As implied by the Figure 1.1, data
  316.    sent from UA to UA may be stored temporarily in several intermediate
  317.    Message Transfer Agents (MTA), i.e., a store-and- forward mechanism
  318.    is being used. An MTA forwards received messages to a next MTA or to
  319.    the recipient UA.
  320.  
  321.    X.400(84) divides layer 7 of the OSI Reference Model into 2
  322.    sublayers, the User Agent Layer (UAL) and the Message Transfer Layer
  323.    (MTL) as shown in the Figure 1.2.
  324.  
  325.    The MTL is involved in the transport of messages from UA to UA, using
  326.    one or several MTAs as intermediaries. By consequence, routing issues
  327.    are entirely dealt with in the MTL. The MTL in fact corresponds to
  328.    the postal service that forwards letters consisting of an envelope
  329.    and a content. Two protocols, P1 and P3, are used between the MTL
  330.    entities (MTA Entity (MTAE), and Submission and Delivery Entity
  331.    (SDE)) to reliably transport messages. The UAL embodies  peer UA
  332.    Entities (UAE), which interpret the content of a message and offer
  333.    specific services to the application process.  Depending on the
  334.    application to be supported on top of the MTL, one of several end-
  335.  
  336.  
  337.  
  338. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 6]
  339.  
  340. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  341.  
  342.  
  343.    to-end protocols (Pc) is used between UAEs. For electronic mail,
  344.    X.400(84) defines the protocol P2 as part of the InterPersonal
  345.    Messaging Service (IPMS). Conceivably other UAL protocols may be
  346.    defined, e.g., a protocol to support the exchange of electronic
  347.    business documents.
  348.  
  349.        --------------------------------------------------------------
  350.                    -----                          -----
  351.        UA layer    |UAE|<----- P2, Pc ----------->|UAE|
  352.                    -----                          -----
  353.        --------------------------------------------------------------
  354.                    ------          ------         -----
  355.        MTA layer   |MTAE|<-- P1 -->|MTAE|<-- P3-->|SDE|
  356.                    ------          ------         -----
  357.        --------------------------------------------------------------
  358.              xxxE = xxx Entity ;   SDE = Submission & Delivery Entity
  359.        --------------------------------------------------------------
  360.                            Fig. 1.2. X.400 Protocols
  361.  
  362.    The structure of an InterPersonal Message (IPM) can be visualised as
  363.    in Figure 1.3. (Note that the envelope is not a part of the IPM; it
  364.    is generated by the MTL).
  365.  
  366.                                                             Forwarded
  367.     Message                                                 IP-message
  368.     -                     ----------      --- ----------    -
  369.     |  message-           |envelope|     /    | PDI    |    |
  370.     |  content   IPM      ----------    /     ----------    |
  371.     |  -         -        ----------   /      ----------    |
  372.     |  |         |  IPM-  |heading |  /       |heading |    |
  373.     |  |         |  body  ---------- /        ----------    |
  374.     |  |         |  -     ----------/         ----------    |
  375.     |  |         |  |     |bodypart|          |bodypart|    |
  376.     |  |         |  |     ----------\         ----------    |
  377.     |  |         |  |     ---------- \        ----------    |
  378.     |  |         |  |     |bodypart|  \       |bodypart|    |
  379.     |  |         |  |     ----------   \      ----------    |
  380.     |  |         |  |          .        \                   |
  381.     |  |         |  |          .         \                  |
  382.     |  |         |  |     ----------      \   ----------    |
  383.     |  |         |  |     |bodypart|       \  |bodypart|    |
  384.     -  -         -  -     ----------        - ----------    -
  385.                                       (PDI = Previous Delivery Info.)
  386.                     Fig. 1.3. X.400 message structure
  387.  
  388.    An IPM heading contains information that is specific for an
  389.    interpersonal message like 'originator', 'subject', etc. Each
  390.    bodypart can contain one information type, text, voice or as a
  391.  
  392.  
  393.  
  394. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 7]
  395.  
  396. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  397.  
  398.  
  399.    special case, a forwarded message. A forwarded message consists of
  400.    the original message together with Previous Delivery Information
  401.    (PDI), which is drawn from the original delivery envelope.
  402.  
  403.    Early experience with X.400(84) showed that the standard had various
  404.    shortcomings. Therefore CCITT, in parallel with ISO, corrected and
  405.    extended the specification during its 1984 to 1988 study period and
  406.    produced a revised standard [17], which was accepted at the 1988
  407.    CCITT Plenary Meeting [10].  Amongst others, X.400(88) differs from
  408.    X.400(84) in that it defines a Message Store (MS), which can be seen
  409.    as a kind of database for messages. An MS enables the end-user to run
  410.    a UA locally, e.g., on a PC, whilst the messages are stored in the
  411.    MS, which is co-located with the MTA. The MTA can thus always deliver
  412.    incoming messages to the MS instead of to the UA. The MS can even
  413.    automatically file incoming messages according to certain criteria.
  414.    Other enhancements in the 88 version concern security and
  415.    distribution lists.
  416.  
  417. 1.2. What is an RFC ?
  418.  
  419.    The Internet, a loosely-organised international collaboration of
  420.    autonomous, interconnected networks, supports host-to-host
  421.    communication through voluntary adherence to open protocols and
  422.    procedures defined by Internet Standards. There are also many
  423.    isolated internets, i.e., sets of interconnected networks, that are
  424.    not connected to the Internet but use the Internet Standards. The
  425.    architecture and technical specifications of the Internet are the
  426.    result of numerous research and development activities conducted over
  427.    a period of two decades, performed by the network R&D community, by
  428.    service and equipment vendors, and by government agencies around the
  429.    world.
  430.  
  431.    In general, an Internet Standard is a specification that is stable
  432.    and well-understood, is technically competent, has multiple,
  433.    independent, and interoperable implementations with operational
  434.    experience, enjoys significant public support, and is recognisably
  435.    useful in some or all parts of the Internet.
  436.  
  437.    The principal set of Internet Standards is commonly known as the
  438.    "TCP/IP protocol suite". As the Internet evolves, new protocols and
  439.    services, in particular those for Open Systems Interconnection (OSI),
  440.    have been and will be deployed in traditional TCP/IP environments,
  441.    leading to an Internet that supports multiple protocol suites.
  442.  
  443.    The following organisations are involved in setting Internet
  444.    standards.
  445.  
  446.    Internet standardisation is an organised activity of the Internet
  447.  
  448.  
  449.  
  450. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 8]
  451.  
  452. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  453.  
  454.  
  455.    Society (ISOC). The ISOC is a professional society that is concerned
  456.    with the growth and evolution of the world-wide Internet, with the
  457.    way in which the Internet is and can be used, and with the social,
  458.    political, and technical issues that arise as a result.
  459.  
  460.    The Internet Engineering Task Force (IETF) is the primary body
  461.    developing new Internet Standard specifications. The IETF is composed
  462.    of many Working Groups, which are organised into areas, each of which
  463.    is co-ordinated by one or more Area Directors.
  464.  
  465.    The Internet Engineering Steering Group (IESG) is responsible for
  466.    technical management of IETF activities and the approval of Internet
  467.    standards specifications, using well-defined rules. The IESG is
  468.    composed of the IETF Area Directors, some at-large members, and the
  469.    chairperson of the IESG/IETF.
  470.  
  471.    The Internet Architecture Board (IAB) has been chartered by the
  472.    Internet Society Board of Trustees to provide quality control and
  473.    process appeals for the standards process, as well as external
  474.    technical liaison, organizational oversight, and long-term
  475.    architectural planning and research.
  476.  
  477.    Any individual or group (e.g., an IETF or RARE working group) can
  478.    submit a document as a so-called Internet Draft. After the document
  479.    is proven stable, the IESG may turn the Internet-Draft into a
  480.    "Requests For Comments" (RFC). RFCs cover a wide range of topics,
  481.    from early discussion of new research concepts to status memos about
  482.    the Internet. All Internet Standards (STDs) are published as RFCs,
  483.    but not all RFCs specify standards. Another sub-series of the RFCs
  484.    are the RARE Technical Reports (RTRs).
  485.  
  486.    As an example, this tutorial also started out as an Internet-Draft.
  487.    After almost one year of discussions and revisions it was approved by
  488.    the IESG as an Informational RFC.
  489.  
  490.    Once a document is assigned an RFC number and published, that RFC is
  491.    never revised or re-issued with the same number. Instead, a revision
  492.    will lead to the document being re-issued with a higher number
  493.    indicating that an older one is obsoleted.
  494.  
  495. 1.3. What is RFC 822 ?
  496.  
  497.    STD 11, RFC 822 defines a standard for the format of Internet text
  498.    messages. Messages consist of lines of text. No special provisions
  499.    are made for encoding drawings, facsimile, speech, or structured
  500.    text. No significant consideration has been given to questions of
  501.    data compression or to transmission and storage efficiency, and the
  502.    standard tends to be free with the number of bits consumed. For
  503.  
  504.  
  505.  
  506. RARE Working Group on Mail and Messaging (WG-MSG)               [Page 9]
  507.  
  508. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  509.  
  510.  
  511.    example, field names are specified as free text, rather than special
  512.    terse codes.
  513.  
  514.    A general "memo" framework is used. That is, a message consists of
  515.    some information in a rigid format (the 'headers'), followed by the
  516.    main part of the message (the 'body'), with a format that is not
  517.    specified in STD 11, RFC 822. It does define the syntax of several
  518.    fields of the headers section; some of these fields must be included
  519.    in all messages.
  520.  
  521.    STD 11, RFC 822 is used in conjunction with a number of different
  522.    message transfer protocol environments (822-MTSs).
  523.  
  524.         - SMTP Networks: On the Internet and other TCP/IP networks,
  525.           STD 11, RFC 822 is used in conjunction with two other
  526.           standards: STD 10, RFC 821, also known as Simple Mail
  527.           Transfer Protocol (SMTP) [1], and RFCs 1034 and 1035
  528.           which specify the Domain Name System [3].
  529.  
  530.         - UUCP Networks: UUCP is the UNIX to UNIX CoPy protocol, which
  531.           is usually used over dialup telephone networks to provide a
  532.           simple message transfer mechanism.
  533.  
  534.         - BITNET: Some parts of Bitnet and related networks use STD
  535.           11, RFC 822 related protocols, with EBCDIC encoding.
  536.  
  537.         - JNT Mail Networks: A number of X.25 networks, particularly
  538.           those associated with the UK Academic Community, use the JNT
  539.           (Joint Network Team) Mail Protocol, also known as Greybook.
  540.  
  541.    STD 11, RFC 822 is based on the assumption that there is an
  542.    underlying service, which in RFC 1327 is called the 822-MTS service.
  543.    The 822-MTS service provides three basic functions:
  544.  
  545.         1. Identification of a list of recipients.
  546.         2. Identification of an error return address.
  547.         3. Transfer of an RFC 822 message.
  548.  
  549.    It is possible to achieve 2) within the RFC 822 header.  Some 822-
  550.    MTS protocols, in particular SMTP, can provide additional
  551.    functionality, but as these are neither mandatory in SMTP, nor
  552.    available in other 822-MTS protocols, they are not considered here.
  553.    Details of aspects specific to two 822-MTS protocols are given in
  554.    Appendices B and C of RFC 1327. An RFC 822 message consists of a
  555.    header, and content which is uninterpreted ASCII text. The header is
  556.    divided into fields, which are the protocol elements. Most of these
  557.    fields are analogous to P2 heading fields, although some are
  558.    analogous to MTS Service Elements.
  559.  
  560.  
  561.  
  562. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 10]
  563.  
  564. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  565.  
  566.  
  567. 1.4. What is RFC 1327 ?
  568.  
  569.    There is a large community using STD 11, RFC 822 based protocols for
  570.    mail services, who will wish to communicate with users of the
  571.    InterPersonal Messaging Service (IPMS) provided by X.400 systems, and
  572.    the other way around. This will also be a requirement in cases where
  573.    RFC 822 communities intend to make a transition to use X.400 (or the
  574.    other way around, which also happens), as conversion will be needed
  575.    to ensure a smooth service transition.
  576.  
  577.    The basic function of a mail gateway can be described as follows:
  578.    receive a mail from one mail world, translate it into the formats of
  579.    the other mail world and send it out again using the routing rules
  580.    and protocols of that other world.
  581.  
  582.    Especially if a message crosses more than one gateway, it is
  583.    important that all gateways have the same understanding of how things
  584.    should be mapped. A simple example of what could go wrong otherwise
  585.    is the following: A sends a message to B through a gateway and B's
  586.    reply to A is being routed through another gateway.
  587.  
  588.    If the two gateways don't use the same mappings, it can be expected
  589.    that the From and To addresses in the original mail and in the answer
  590.    don't match, which is, to say the least, very confusing for the end-
  591.    users (consider what happens if automated processes communicate via
  592.    mail). More serious things can happen to addresses if a message
  593.    crosses more than one gateway on its way from the originator to the
  594.    recipient. As a real-life example, consider receiving a message from:
  595.  
  596.       Mary Plork <MMP_+a_ARG_+lMary_Plork+r%MHS+d_A0CD8A2B01F54FDC-
  597.       A0CB9A2B03F53FDC%ARG_Incorporated@argmail.com>
  598.  
  599.    This is not what you would call user-friendly addressing.... RFC 1327
  600.    describes a set of mappings that will enable a more transparent
  601.    interworking between systems operating X.400 (both 84 and 88) and
  602.    systems using RFC 822, or protocols derived from STD 11, RFC 822.
  603.  
  604.    RFC 1327 describes all mappings in term of X.400(88). It defines how
  605.    these mappings should be applied to X.400(84) systems in its Appendix
  606.    G.
  607.  
  608.    Some words about the history of RFC 1327: It started out in June
  609.    1986, when RFC 987 defined for X.400(84) what RFC 1327 defines for
  610.    X.400(84 and 88). RFC 1026 specified a number of additions and
  611.    corrections to RFC 987. In December 1989, RFC 1138, which had a very
  612.    short lifetime, was the first one to deal with X.400(88). It was
  613.    obsoleted by RFC 1148 in March 1990. Finally, in May 1992, RFC 1327
  614.    obsoleted all of its ancestors.
  615.  
  616.  
  617.  
  618. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 11]
  619.  
  620. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  621.  
  622.  
  623. 2. Service Elements
  624.  
  625.    Both RFC 822 and X.400 messages consist of certain service elements
  626.    (such as 'originator' and 'subject'). As long as a message stays
  627.    within its own world, the behaviour of such service elements is well
  628.    defined. An important goal for a gateway is to maintain the highest
  629.    possible service level when a message crosses the boundary between
  630.    the two mail worlds.
  631.  
  632.    When a user originates a message, a number of services are available.
  633.    RFC 1327 describes, for each service elements, to what extent it is
  634.    supported for a recipient accessed through a gateway.  There are
  635.    three levels of support:
  636.  
  637.         - Supported: Some of the mappings are quite straight-forward,
  638.           such as '822.Subject:' <-> 'IPMS.Subject'.
  639.  
  640.         - Not supported: There may be a complete mismatch: certain
  641.           service elements exist only in one of the two worlds (e.g.,
  642.           interpersonal notifications).
  643.  
  644.         - Partially supported: When similar service elements exist in
  645.           both worlds, but with slightly different interpretations,
  646.           some tricks may be needed to provide the service over the
  647.           gateway border.
  648.  
  649.    Apart from mapping between the service elements, a gateway must also
  650.    map the types and values assigned to these service elements.  Again,
  651.    this may in certain cases be very simple, e.g., 'IA5 -> ASCII'. The
  652.    most complicated example is mapping address spaces. The problem is
  653.    that address spaces are not something static that can be defined
  654.    within RFC 1327. Address spaces change continuously, and they are
  655.    defined by certain addressing authorities, which are not always
  656.    parallel in the RFC 822 and the X.400 world. A valid mapping between
  657.    two addresses assumes however that there is 'administrative
  658.    equivalence' between the two domains in which the addresses exist
  659.    (see also [13]).
  660.  
  661.    The following basic mappings are defined in RFC 1327. When going from
  662.    RFC 822 to X.400, an RFC 822 message and the associated 822- MTS
  663.    information is always mapped into an IPM (MTA, MTS, and IPMS
  664.    Services). Going from X.400 to RFC 822, an RFC 822 message and the
  665.    associated 822-MTS information may be derived from:
  666.  
  667.         - A Report (MTA, and MTS Services)
  668.  
  669.         - An InterPersonal Notification (IPN) (MTA, MTS, and IPMS
  670.           services)
  671.  
  672.  
  673.  
  674. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 12]
  675.  
  676. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  677.  
  678.  
  679.  
  680.         - An InterPersonal Message (IPM) (MTA, MTS, and IPMS services)
  681.  
  682.    Probes (MTA Service) have no equivalent in STD 10, RFC 821 or STD 11,
  683.    RFC 822 and are thus handled by the gateway. The gateway's Probe
  684.    confirmation should be interpreted as if the gateway were the final
  685.    MTA to which the Probe was sent. Optionally, if the gateway uses RFC
  686.    821 as an 822-MTS, it may use the results of the 'VRFY' command to
  687.    test whether it would be able to deliver (or forward) mail to the
  688.    mailbox under probe.
  689.  
  690.    MTS Messages containing Content Types other than those defined by the
  691.    IPMS are not mapped by the gateway, and should be rejected at the
  692.    gateway.
  693.  
  694.    Some basic examples of mappings between service elements are listed
  695.    below.
  696.  
  697.     Service elements:
  698.  
  699.          RFC 822         X.400
  700.          ------------------------------------------------
  701.          Reply-To:       IPMS.Heading.reply-recipients
  702.          Subject:        IPMS.Heading.subject
  703.          In-Reply-To:    IPMS.Heading.replied-to-ipm
  704.          References:     IPMS.Heading.related-IPMs
  705.          To:             IPMS.Heading.primary-recipients
  706.          Cc:             IPMS.Heading.copy-recipients
  707.  
  708.     Service element types:
  709.  
  710.          RFC 822         X.400
  711.          ------------------------------------------------
  712.          ASCII           PrintableString
  713.          Boolean         Boolean
  714.  
  715.     Service element values:
  716.  
  717.          RFC 822         X.400
  718.          ------------------------------------------------
  719.          oh_dear         oh(u)dear
  720.          False           00000000
  721.  
  722.    There are some mappings between service elements that are rather
  723.    tricky and important enough to mention in this tutorial. These are
  724.    the mappings of origination-related headers and some envelope fields:
  725.  
  726.  
  727.  
  728.  
  729.  
  730. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 13]
  731.  
  732. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  733.  
  734.  
  735.     RFC 822 -> X.400:
  736.  
  737.         - If Sender: is present, Sender: is mapped to
  738.           IPMS.Heading.originator, and From: is mapped to
  739.           IPMS.Heading.authorizing-users. If not, From: is mapped to
  740.           IPMS.Heading.originator.
  741.  
  742.     X.400 -> RFC 822
  743.  
  744.         - If IPMS.Heading.authorizing-users is present,
  745.           IPMS.Heading.originator is mapped to Sender:, and
  746.           IPMS.Heading.authorizing-users is mapped to From: . If not,
  747.           IPMS.Heading.originator is mapped to From:.
  748.  
  749.     Envelope attributes
  750.  
  751.         - RFC 1327 doesn't define how to map the MTS.OriginatorName and
  752.           the MTS.RecipientName (often referred to as the P1.originator
  753.           and P1.recipient), since this depends on which underlying 822-
  754.           MTS is used. In the very common case that RFC 821 (SMTP) is
  755.           used for this purpose, the mapping is normally as follows:
  756.  
  757.             MTS.Originator-name <->   MAIL FROM:
  758.             MTS.Recipient-name  <->   RCPT TO:
  759.  
  760.    For more details, refer to RFC 1327, chapters 2.2 and 2.3.
  761.  
  762. 3. Address mapping
  763.  
  764.    As address mapping is often considered the most complicated part of
  765.    mapping between service element values, this subject is given a
  766.    separate chapter in this tutorial.
  767.  
  768.    Both RFC 822 and X.400 have their own specific address formats. RFC
  769.    822 addresses are text strings (e.g., "plork@tlec.nl"), whereas X.400
  770.    addresses are binary encoded sets of attributes with values. Such
  771.    binary addresses can be made readable for a human user by a number of
  772.    notations; for instance:
  773.  
  774.         C=zz
  775.         ADMD=ade
  776.         PRMD=fhbo
  777.         O=a bank
  778.         S=plork
  779.         G=mary
  780.  
  781.    The rest of this chapter deals with addressing issues and mappings
  782.    between the two address forms in more detail.
  783.  
  784.  
  785.  
  786. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 14]
  787.  
  788. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  789.  
  790.  
  791. 3.1. X.400 addresses
  792.  
  793.    As already stated above, an X.400 address is modelled as a set of
  794.    attributes. Some of these attributes are mandatory, others are
  795.    optional. Each attribute has a type and a value, e.g., the Surname
  796.    attribute has type IA5text, and an instance of this attribute could
  797.    have the value 'Kille'. Attributes are divided into Standard
  798.    Attributes (SAs) and Domain Defined Attributes (DDAs).
  799.  
  800.    X.400 defines four basic forms of addresses ([17], 18.5), of which
  801.    the 'Mnemonic O/R Address' is the form that is most used, and is the
  802.    only form that is dealt with in this tutorial. This is roughly the
  803.    same address format as what in the 84 version was known as 'O/R
  804.    names: form 1, variant 1' ([16] 3.3.2).
  805.  
  806. 3.1.1. Standard Attributes
  807.  
  808.    Standard Attributes (SAs) are attributes that all X.400 installations
  809.    are supposed to 'understand' (i.e., use for routing), for example:
  810.    'country name', 'given name' or 'organizational unit'.  The most
  811.    commonly used SAs in X.400(84) are:
  812.  
  813.         surName (S)
  814.         givenName (G)
  815.         initials (I*) (Zero or more)
  816.         generationQualifier (GQ)
  817.         OrganizationalUnits (OU1 OU2 OU3 OU4)
  818.         OrganizationName (O)
  819.         PrivateDomainName (PRMD)
  820.         AdministrationDomainName (ADMD)
  821.         CountryName (C)
  822.  
  823.    The combination of S, G, I* and GQ is often referred to as the
  824.    PersonalName (PN).
  825.  
  826.    Although there is no hierarchy (of addressing authorities) defined by
  827.    the standards, the following hierarchy is considered natural:
  828.  
  829.         PersonalName < OU4 < OU3 < OU2 < OU1 < O < P < A < C
  830.  
  831.    In addition to the SAs listed above, X.400(88) defines some extra
  832.    attributes, the most important of which is
  833.  
  834.         Common Name (CN)
  835.  
  836.    CN can be used instead of or even together with PN. The problem in
  837.    X.400(84) was that PN (S G I* GQ) was well suited to represent
  838.    persons, but not roles and abstract objects, such as distribution
  839.  
  840.  
  841.  
  842. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 15]
  843.  
  844. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  845.  
  846.  
  847.    lists. Even though postmaster clearly is a role, not someone's real
  848.    surname, it is quite usual in X.400(84) to address a postmaster with
  849.    S=postmaster. In X.400(88), the same postmaster would be addressed
  850.    with CN=postmaster .
  851.  
  852.    The attributes C and ADMD are mandatory (i.e., they must be present),
  853.    and may not be empty. At least one of the attributes PRMD, O, OU, PN
  854.    and CN must be present.
  855.  
  856.    PRMD and ADMD are often felt to be routing attributes that don't
  857.    really belong in addresses. As an example of how such address
  858.    attributes can be used for the purpose of routing, consider two
  859.    special values for ADMD:
  860.  
  861.         - ADMD=0; (zero) should be interpreted as 'the PRMD in this
  862.           address is not connected to any ADMD'
  863.  
  864.         - ADMD= ; (single SPACE) should be interpreted as 'the PRMD in
  865.           this address is reachable via any ADMD in this country'. It
  866.           is expected that ISO will express this 'any' value by means
  867.           of a missing ADMD attribute in future versions of MOTIS.
  868.           This representation can uniquely identify the meaning 'any',
  869.           as a missing or empty ADMD field as such is not allowed.
  870.  
  871.    Addresses are defined in X.400 using the Abstract Syntax Notation One
  872.    (ASN.1). X.409 defines how definitions in ASN.1 should be encoded
  873.    into binary format. Note that the meaning, and thus the ASN.1
  874.    encoding, of a missing attribute is not the same as that of an empty
  875.    attribute. In addressing, this difference is often represented as
  876.    follows:
  877.  
  878.         - PRMD=; means that this attribute is present in the address,
  879.           but its value is empty. Since this is not very useful, it's
  880.           hardly ever used. The only examples the author knows of
  881.           were caused by mail managers who should have had this
  882.           tutorial before they started defining their addresses :-)
  883.  
  884.         - PRMD=@; means that this attribute is not present in the
  885.           address. {NB. This is only necessary if an address notation
  886.           (see 3.1.3) requires that every single attribute in the
  887.           hierarchy is somehow listed. Otherwise, a missing attribute
  888.           can of course be represented by simply not mentioning it.
  889.           This means that this syntax is mostly used in mapping rules,
  890.           not by end users.}
  891.  
  892.    Addresses that only contain SAs are often referred to as Standard
  893.    Attribute Addresses (SAAs).
  894.  
  895.  
  896.  
  897.  
  898. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 16]
  899.  
  900. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  901.  
  902.  
  903. 3.1.2. Domain Defined Attributes
  904.  
  905.    Domain Defined Attributes (DDAs) can be used in addition to Standard
  906.    Attributes. An instance of a DDA consists of a type and a value. DDAs
  907.    are meant to have a meaning only within a certain context (originally
  908.    this was supposed to be the context of a certain management domain,
  909.    hence the name DDA), such as a company context.
  910.  
  911.    As an example, a company might want to define a DDA for describing
  912.    internal telephone numbers: DDA type=phone value=9571.
  913.  
  914.    A bit tricky is the use of DDAs to encode service element types or
  915.    values that are only available on one side of a service gateway.  The
  916.    most important examples of such usage are defined in:
  917.  
  918.        RFC 1327 (e.g., DDA type=RFC-822 value=u(u)ser(a)isode.com)
  919.  
  920.        RFC 1328 (e.g., DDA type=CommonName value=mhs-discussion-list)
  921.  
  922.    Addresses that contain both SAs and DDAs are often referred to as DDA
  923.    addresses.
  924.  
  925. 3.1.3. X.400 address notation
  926.  
  927.    X.400 only prescribes the binary encoding of addresses, it doesn't
  928.    standardise how such addresses should be written on paper or what
  929.    they should look like in a user interface on a computer screen.
  930.    There exist a number of recommendations for X.400 address
  931.    representation though.
  932.  
  933.   - JTC proposed an annex to CCITT Rec. F.401 and ISO/IEC 10021-2,
  934.     called 'Representation of O/R addresses for human usage'. According
  935.     to this proposal, an X.400 address would look as follows:
  936.  
  937.     G=jo; S=plork; O=a bank; OU1=owe; OU2=you; P=fhbo; A=ade; C=zz
  938.  
  939.       Note that in this format, the order of O and the OUs is exactly
  940.       the opposite of what one would expect intuitively (the attribute
  941.       hierarchy is increasing from left to right, except for the O and
  942.       OUs, where it's right to left. The reasoning behind this is that
  943.       this sequence is following the example of a postal address). This
  944.       proposal has been added (as a recommendation) to the 1992 version
  945.       of the standards.
  946.  
  947.   - Following what was originally used in the DFN-EAN software, most
  948.     EAN versions today use an address representation similar to the JTC
  949.     proposal, with a few differences:
  950.  
  951.  
  952.  
  953.  
  954. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 17]
  955.  
  956. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  957.  
  958.  
  959.             - natural ordering for O and OUs
  960.             - no numbering of OUs.
  961.             - allows writing ADMD and PRMD instead of A and P
  962.  
  963.     The address in the example above could, in EAN, be represented as:
  964.  
  965.     G=jo; S=plork; OU=you; OU=owe; O=a bank; PRMD=fhbo; ADMD=ade; C=zz
  966.  
  967.     This DFN-EAN format is still often referred to as _the_ 'readable
  968.     format'.
  969.  
  970.   - The RARE Working Group on Mail and Messaging, WG-MSG, has made a
  971.     recommendation that is very similar to the DFN-EAN format, but with
  972.     the hierarchy reversed. Further, ADMD and PRMD are used instead of
  973.     A and P. This results in the address above being represented as:
  974.  
  975.     C=zz; ADMD=ade; PRMD=fhbo; O=a bank; OU=owe; OU=you; S=plork; G=jo
  976.  
  977.     This format is recognised by most versions of the EAN software. In
  978.     the R&D community, this is one of the most popular address
  979.     representations for business cards, letter heads, etc. It is also
  980.     the format that will be used for the examples in this tutorial.
  981.     (NB. The syntax used here for describing DDAs is as follows:
  982.     DD.'type'='value', e.g., DD.phone=9571)
  983.  
  984.   - RFC 1327 defines a slash separated address representation:
  985.  
  986.     /G=jo/S=plork/OU=you/OU=owe/O=a bank/P=fhbo/A=ade/C=zz/
  987.  
  988.     Not only is this format used by the PP software, it is also
  989.     widespread for business cards and letter heads in the R&D
  990.     community.
  991.  
  992.   - RFC 1327 finally defines yet another format for X.400 _domains_
  993.     (not for human users):
  994.  
  995.     OU$you.OU$owe.O$a bank.P$fhbo.A$ade.C$zz
  996.  
  997.     The main advantage of this format is that it is better machine-
  998.     parseble than the others, which also immediately implies its main
  999.     disadvantage: it is barely readable for humans. Every attribute
  1000.     within the hierarchy should be listed, thus a missing attribute
  1001.     must be represented by the '@' sign
  1002.     (e.g., $a bank.P$@.A$ade.C$zz).
  1003.  
  1004.   - Paul-Andre Pays (INRIA) has proposed a format that combines the
  1005.     readability of the JTC format with the parsebility of the RFC 1327
  1006.     domain format. Although a number of operational tools within the GO-
  1007.  
  1008.  
  1009.  
  1010. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 18]
  1011.  
  1012. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1013.  
  1014.  
  1015.     MHS community are already based on (variants of) this proposal, its
  1016.     future is still uncertain.
  1017.  
  1018. 3.2. RFC 822 addresses
  1019.  
  1020.    An RFC 822 address is an ASCII string of the following form:
  1021.  
  1022.         localpart@domainpart
  1023.  
  1024.     "domainpart" is sub-divided into
  1025.  
  1026.     domainpart = sdom(n).sdom(n-1)....sdom(2).sdom(1).dom
  1027.  
  1028.     "sdom" stands for "subdomain", "dom" stands for "top-level-domain".
  1029.  
  1030.     "localpart" ;is normally a login name, and thus typically is a
  1031.     surname or an abbreviation for this. It can also designate a local
  1032.     distribution list.
  1033.  
  1034.     The hierarchy (of addressing authorities) in an RFC 822 address is
  1035.     as follows:
  1036.  
  1037.         localpart < sdom(n) < sdom(n-1) <...< dom
  1038.  
  1039.     Some virtual real-life examples:
  1040.  
  1041.         joemp@tlec.nl
  1042.         tsjaka.kahn@walhalla.diku.dk
  1043.         a13_vk@cs.rochester.edu
  1044.  
  1045.     In the above examples, 'nl', 'dk', and 'edu' are valid,
  1046.     registered, top level domains. Note that some networks that have
  1047.     their own addressing schemes are also reachable by way of 'RFC
  1048.     822-like' addressing. Consider the following addresses:
  1049.  
  1050.         oops!user          (a UUCP address)
  1051.         V13ENZACC@CZKETH5A (a BITNET address)
  1052.  
  1053.     These addresses can be expressed in RFC 822 format:
  1054.  
  1055.         user@oops.uucp
  1056.         V13ENZACC@CZKETH5A.BITNET
  1057.  
  1058.    Note that the domains '.uucp' and '.bitnet' have no registered
  1059.    Internet routing.  Such addresses must always be routed to a gateway
  1060.    (how this is done is outside the scope of this tutorial).
  1061.  
  1062.    As for mapping such addresses to X.400, there is no direct mapping
  1063.  
  1064.  
  1065.  
  1066. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 19]
  1067.  
  1068. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1069.  
  1070.  
  1071.    defined between X.400 on the one hand and UUCP and BITNET on the
  1072.    other, so they are normally mapped to RFC 822 style first, and then
  1073.    to X.400 if needed.
  1074.  
  1075. 3.3. RFC 1327 address mapping
  1076.  
  1077.    Despite the difference in address formats, the address spaces defined
  1078.    by RFC 822 and X.400 are quite similar. The most important parallels
  1079.    are:
  1080.  
  1081.         - both address spaces are hierarchical
  1082.         - top level domains and country codes are often the same
  1083.         - localparts and surnames are often the same
  1084.  
  1085.    This similarity can of course be exploited in address mapping
  1086.    algorithms. This is also done in RFC 1327 (NB only in the exception
  1087.    mapping algorithm. See chapter 3.3.2).
  1088.  
  1089.    Note that the actual mapping algorithm is much more complicated than
  1090.    shown below. For details, see RFC 1327, chapter 4.
  1091.  
  1092. 3.3.1. Default mapping
  1093.  
  1094.    The default RFC 1327 address mapping can be visualised as a function
  1095.    with input and output parameters:
  1096.  
  1097.           address information of the gateway performing the mapping
  1098.                                       |
  1099.                                       v
  1100.                              +-----------------+
  1101.         RFC 822 address <--->| address mapping | <---> X.400 address
  1102.                              +-----------------+
  1103.  
  1104.    I.e., to map an address from X.400 to RFC 822 or vice versa, the only
  1105.    extra input needed is the address information of the local gateway.
  1106.  
  1107. 3.3.1.1. X.400 -> RFC 822
  1108.  
  1109.    There are two kinds of default address mapping from X.400 to RFC 822:
  1110.    one to map a real X.400 address to RFC 822, and another to decode an
  1111.    RFC 822 address that was mapped to X.400 (i.e., to reverse the
  1112.    default RFC 822 -> X.400 mapping).
  1113.  
  1114.    To map a real X.400 address to RFC 822, the slash separated notation
  1115.    of the X.400 address (see chapter 3.1.) is mapped to 'localpart', and
  1116.    the local RFC 822 domain of the gateway that performs the mapping is
  1117.    used as the domain part. As an example, the gateway 'gw.switch.ch'
  1118.    would perform the following mappings:
  1119.  
  1120.  
  1121.  
  1122. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 20]
  1123.  
  1124. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1125.  
  1126.  
  1127.         C=zz; ADMD=ade; PRMD=fhbo; O=tlec; S=plork; ->
  1128.         /C=zz/ADMD=ade/PRMD=fhbo/O=tlec/S=plork/@gw.switch.ch
  1129.  
  1130.         C=zz; ADMD=ade; PRMD=fhbo; O=a bank; S=plork->
  1131.         "/C=zz/ADMD=ade/PRMD=fhbo/O=a bank/S=plork/"@gw.switch.ch
  1132.  
  1133.    The quotes in the second example are mandatory if the X.400 address
  1134.    contains spaces, otherwise the syntax rules for the RFC 822 localpart
  1135.    would be violated.
  1136.  
  1137.    This default mapping algorithm is generally referred to as 'left-
  1138.    hand-side encoding'.
  1139.  
  1140.    To reverse the default RFC 822 -> X.400 mapping (see chapter
  1141.    3.3.1.2): if the X.400 address contains a DDA of the type RFC-822,
  1142.    the SAs can be discarded, and the value of this DDA is the desired
  1143.    RFC 822 address (NB. Some characters in the DDA value must be decoded
  1144.    first. See chapter 3.3.1.2.). For example, the gateway
  1145.  
  1146.         DD.RFC-822=bush(a)dole.us; C=nl; ADMD=tlec; PRMD=GW
  1147.         ->
  1148.         bush@dole.us
  1149.  
  1150. 3.3.1.2. RFC 822 -> X.400
  1151.  
  1152.    There are also two kinds of default address mapping from RFC 822 to
  1153.    X.400: one to map a real RFC 822 address to X.400, and another to
  1154.    decode an X.400 address that was mapped to RFC 822 (i.e., to reverse
  1155.    the default X.400 -> RFC 822 mapping).
  1156.  
  1157.    To map a real RFC 822 address to X.400, the RFC 822 address is
  1158.    encoded in a DDA of type RFC-822 , and the SAs of the local gateway
  1159.    performing the mapping are added to form the complete X.400 address.
  1160.    This mapping is generally referred to as 'DDA mapping'. As an
  1161.    example, the gateway 'C=nl; ADMD=tlec; PRMD=GW' would perform the
  1162.    following mapping:
  1163.  
  1164.         bush@dole.us  ->
  1165.         DD.RFC-822=bush(a)dole.us; C=nl; ADMD=tlec; PRMD=GW
  1166.  
  1167.    As for the encoding/decoding of RFC 822 addresses in DDAs, it is
  1168.    noted that RFC 822 addresses may contain characters (@ ! % etc.) that
  1169.    cannot directly be represented in a DDA. DDAs are of the restricted
  1170.    character set type 'PrintableString', which is a subset of IA5
  1171.    (=ASCII). Characters not in this set need a special encoding. Some
  1172.    examples (For details, refer to RFC 1327, chapter 3.4.):
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 21]
  1179.  
  1180. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1181.  
  1182.  
  1183.         100%name@address   -> DD.RFC-822;=100(p)name(a)address
  1184.         u_ser!name@address -> DD.RFC-822;=u(u)ser(b)name(a)address
  1185.  
  1186.    To decode an X.400 address that was mapped to RFC 822: if the RFC 822
  1187.    address has a slash separated representation of a complete X.400
  1188.    mnemonic O/R address in its localpart, that address is the result of
  1189.    the mapping. As an example, the gateway 'gw.switch.ch' would perform
  1190.    the following mapping:
  1191.  
  1192.         /C=zz/ADMD=ade/PRMD=fhbo/O=tlec/S=plork/G=mary/@gw.switch.ch
  1193.         ->
  1194.         C=zz; ADMD=ade; PRMD=fhbo; O=tlec; S=plork; G=mary
  1195.  
  1196. 3.3.2. Exception mapping according to mapping tables
  1197.  
  1198.    Chapter 3.3.1. showed that it is theoretically possible to use RFC
  1199.    1327 with default mapping only. Although this provides a very simple,
  1200.    straightforward way to map addresses, there are some very good
  1201.    reasons not to use RFC 1327 this way:
  1202.  
  1203.         - RFC 822 users are used to writing simple addresses of the
  1204.           form 'localpart@domainpart'. They often consider X.400
  1205.           addresses, and thus also the left-hand-side encoded
  1206.           equivalents, as unnecessarily long and complicated. They
  1207.           would rather be able to address an X.400 user as if she had a
  1208.           'normal' RFC 822 address. For example, take the mapping
  1209.  
  1210.             C=zz; ADMD=ade; PRMD=fhbo; O=tlec; S=plork;     ->
  1211.             /C=zz/ADMD=ade/PRMD=fhbo/O=tlec/S=plork/@gw.switch.ch
  1212.  
  1213.           from chapter 3.3.1.1. RFC 822 users would find it much more
  1214.           'natural' if this address could be expressed in RFC 822 as:
  1215.  
  1216.             plork@tlec.fhbo.ade.nl
  1217.  
  1218.         - X.400 users are used to using X.400 addresses with SAs only.
  1219.           They often consider DDA addresses as complicated, especially
  1220.           if they have to encode the special characters, @ % ! etc,
  1221.           manually. They would rather be able to address an RFC 822
  1222.           user as if he had a 'normal' X.400 address. For example, take
  1223.           the mapping
  1224.  
  1225.             bush@dole.us
  1226.             ->
  1227.             DD.RFC-822=bush(a)dole.us;
  1228.             C=nl; ADMD= ; PRMD=tlec; O=gateway
  1229.  
  1230.           from chapter 3.3.1.2. X.400 users would find it much more
  1231.  
  1232.  
  1233.  
  1234. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 22]
  1235.  
  1236. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1237.  
  1238.  
  1239.           'natural' if this address could be expressed in X.400 as:
  1240.  
  1241.             C=us; ADMD=dole; S=bush
  1242.  
  1243.         - Many organisations are using both RFC 822 and X.400
  1244.           internally, and still want all their users to have a simple,
  1245.           unique address in both mail worlds. Note that in the default
  1246.           mapping, the mapped form of an address completely depends on
  1247.           which gateway  performed the mapping. This also results in a
  1248.           complication of a more technical nature:
  1249.  
  1250.         - The tricky 'third party problem'. This problem need not
  1251.           necessarily be understood to read the rest of this chapter.
  1252.           If it looks too complicated, please feel free to skip it
  1253.           until you are more familiar with the basics.
  1254.  
  1255.           The third party problem is a routing problem caused by
  1256.           mapping. As an example for DDA mappings (the example holds
  1257.           just as well for left-hand-side encoding), consider the
  1258.           following situation (see Fig. 3.1.): RFC 822 user X in
  1259.           country A sends a message to two recipients: RFC 822 user Y,
  1260.           and X.400 user Z, both in country B:
  1261.  
  1262.             From: X@A
  1263.             To:   Y@B ,
  1264.                   /C=B/.../S=Z/@GW.A
  1265.  
  1266.           Since the gateway in country A maps all addresses in the
  1267.           message, Z will see both X's and Y's address as DDA-encoded
  1268.           RFC 822 addresses, with the SAs of the gateway in country A:
  1269.  
  1270.             From: DD.RFC-822=X(a)A; C=A;....;O=GW
  1271.             To:   DD.RFC-822=Y(a)B; C=A;....;O=GW ,
  1272.                   C=B;...;S=Z
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 23]
  1291.  
  1292. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1293.  
  1294.  
  1295.  
  1296.             |       ------------         ---------
  1297.             |       |X: RFC 822|<------->|gateway|
  1298.             |       ------------         ---------
  1299.             | A           |                  ^
  1300.             \             |                  |
  1301.              \---------------------------------------------
  1302.                           |                  |
  1303.              /---------------------------------------------
  1304.             /             |                  |
  1305.             | B           |                  v
  1306.             |             |              -----------
  1307.             |             |              |Z: X.400 |
  1308.             |             |              -----------
  1309.             |             |                  .
  1310.             |             |                  .
  1311.             |             |                  .
  1312.             |             |                  .
  1313.             |             |                  .
  1314.             |             v                  v
  1315.             |        ------------         ---------
  1316.             |        |Y: RFC 822|<........|gateway|
  1317.             |        ------------         ---------
  1318.  
  1319.                     Fig. 3.1 The third party problem
  1320.  
  1321.  
  1322.          Now if Z wants to 'group reply' to both X and Y, his reply to Y
  1323.          will be routed over the gateway in country A, even though Y is
  1324.          located in the same country:
  1325.  
  1326.                      From: C=B;...;S=Z
  1327.                      To:   DD.RFC-822=Y(a)B; C=A;....;O=GW ,
  1328.                            DD.RFC-822=X(a)A; C=A;....;O=GW
  1329.  
  1330.          The best way to travel for a message from Z to Y would of
  1331.          course have been over the gateway in country B:
  1332.  
  1333.                      From: C=B;...;S=Z
  1334.                      To:   DD.RFC-822=Y(a)B; C=B;....;O=GW ,
  1335.                            DD.RFC-822=X(a)A; C=A;....;O=GW
  1336.  
  1337.          The third party problem is caused by the fact that routing
  1338.          information is mapped into addresses.
  1339.  
  1340.          Ideally, the third party problem shouldn't exist. After all,
  1341.          address mapping affects addresses, and an address is not a
  1342.          route.... The reality is different however. For instance, very
  1343.  
  1344.  
  1345.  
  1346. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 24]
  1347.  
  1348. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1349.  
  1350.  
  1351.          few X.400 products are capable to route messages on the
  1352.          contents of a DDA (actually, only RFC 1327 gateways will be
  1353.          able to interpret this type of DDA, and who says that the reply
  1354.          will pass a local gateway on its route back?).  Similar
  1355.          limitations hold for the other direction: an RFC 822 based
  1356.          mailer is not even allowed (see [5]) to make routing decisions
  1357.          of the content of a left-hand-side encoded X.400 address if the
  1358.          domain part is not its own.  So in practice, addressing and
  1359.          (thus also mapping) will very well affect routing.
  1360.  
  1361.    To make mapping between addresses more user friendly, and to avoid
  1362.    the problems shown above, RFC 1327 allows for overruling the default
  1363.    left-hand-side encoding and DDA mapping algorithms. This is done by
  1364.    specifying associations (mapping rules) between certain domainparts
  1365.    and X.400 domains. An X.400 domain (for our purposes; CCITT has a
  1366.    narrower definition...) consists of the domain-related SAs of a
  1367.    Mnemonic O/R address (i.e., all SAs except PN and CN). The idea is to
  1368.    use the similarities between both address spaces, and directly map
  1369.    similar address parts onto each other. If, for the domain in the
  1370.    address to be mapped, an explicit mapping rule can be found, the
  1371.    mapping is performed between:
  1372.  
  1373.         localpart     <->   PersonalName
  1374.         domainpart    <->   X.400 domain
  1375.  
  1376.    The address information of the gateway is only used as an input
  1377.    parameter if no mapping rule can be found, i.e., if the address
  1378.    mapping must fall back to its default algorithm.
  1379.  
  1380.    The complete mapping function can thus be visualised as follows:
  1381.  
  1382.  
  1383.           address information of the gateway performing the mapping
  1384.                                       |
  1385.                                       v
  1386.                              +-----------------+
  1387.         RFC 822 address <--->| address mapping | <---> X.400 address
  1388.                              +-----------------+
  1389.                                       ^
  1390.                                       |
  1391.                     domain associations (mapping rules)
  1392.  
  1393. 3.3.2.1. PersonalName and localpart mapping
  1394.  
  1395.    Since the mapping between these address parts is independent of the
  1396.    mapping rules that are used, and because it follows a simple, two-
  1397.    way algorithmic approach, this subject is discussed in a separate
  1398.    sub-chapter first.
  1399.  
  1400.  
  1401.  
  1402. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 25]
  1403.  
  1404. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1405.  
  1406.  
  1407.    The X.400 PersonalName consists of givenName, initials, and surName.
  1408.    RFC 1327 assumes that generationQualifier is not used.
  1409.  
  1410.    To map a localpart to an X.400 PN, the localpart is scanned for dots,
  1411.    which are considered delimiters between the components of PN, and
  1412.    also between single initials. In order not to put too much detail in
  1413.    this tutorial, only a few examples are shown here. For the detailed
  1414.    algorithm, see RFC 1327, chapter 4.2.1.
  1415.  
  1416.         Marshall.Rose             <->   G=Marshall;S=Rose
  1417.         M.T.Rose                  <->   I=MT;S=Rose
  1418.         Marshall.M.T.Rose         <->   G=Marshall;I=MT;S=Rose
  1419.  
  1420.    To map an X.400 PN to an RFC 822 localpart, take the non-empty PN
  1421.    attributes, put them into their hierarchical order (G I* S), and
  1422.    connect them with periods.
  1423.  
  1424.    Some exceptions are caused by the fact that left-hand-side encoding
  1425.    can also be mixed with exception mapping. This is shown in more
  1426.    detail in the following sub-chapters.
  1427.  
  1428. 3.3.2.2. X.400 domain and domainpart mapping
  1429.  
  1430.    A mapping rule associates two domains: an X.400 domain and an RFC 822
  1431.    domain. The X.400 domain is written in the RFC 1327 domain notation
  1432.    (See 3.1.3.), so that both domains have the same hierarchical order.
  1433.    The domains are written on one line, separated by a '#' sign. For
  1434.    instance:
  1435.  
  1436.         arcom.ch#ADMD$arcom.C$ch#
  1437.         PRMD$tlec.ADMD$ade.C$nl#tlec.nl#
  1438.  
  1439.    A mapping rule must at least contain a top level domain and a country
  1440.    code. If an address must be mapped, a mapping rule with the longest
  1441.    domain match is sought. The associated domain in the mapping rule is
  1442.    used as the domain of the mapped address. The remaining domains are
  1443.    mapped one by one following the natural hierarchy. Concrete examples
  1444.    are shown in the following subchapters.
  1445.  
  1446. 3.3.2.2.1. X.400 -> RFC 822
  1447.  
  1448.    As an example, assume the following mapping rule is defined:
  1449.  
  1450.            PRMD$tlec.ADMD$ade.C$nl#tlec.nl#
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 26]
  1459.  
  1460. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1461.  
  1462.  
  1463.    Then the address C=nl; ADMD=ade; PRMD=tlec; O=you; OU=owe; S=plork
  1464.  
  1465.            S      OU  O  PRMD  ADMD  Country
  1466.            |      |   |  |     |     |
  1467.            plork owe you tlec  ade   nl
  1468.  
  1469.    would be mapped as follows. The Surname 'plork' is mapped to the
  1470.    localpart 'plork', see chapter 3.3.2.1. The domain
  1471.  
  1472.            localpart
  1473.               |  sdom3
  1474.               |    | sdom2
  1475.               |    |   |  sdom1
  1476.               |    |   |   |  top-level-domain
  1477.               |    |   |   |   |
  1478.            plork@         tlec.nl
  1479.  
  1480.    The remaining SAs (O and one OU) are mapped one by one following the
  1481.    natural hierarchy: O is mapped to sdom2, OU is mapped to sdom3:
  1482.  
  1483.            localpart
  1484.               | sdom3
  1485.               |  | sdom2
  1486.               |  |   |  sdom1
  1487.               |  |   |   |  top-level-domain
  1488.               |  |   |   |    |
  1489.            plork@owe.you.tlec.nl
  1490.  
  1491.    Thus the mapped address is:
  1492.  
  1493.            plork@owe.you.tlec.nl
  1494.  
  1495.    The table containing the listing of all such mapping rules, which is
  1496.    distributed to all gateways world-wide, is normally referred to as
  1497.    'mapping table 1'. Other commonly used filenames (also depending on
  1498.    which software your are using) are:
  1499.  
  1500.            'or2rfc'
  1501.            'mapping 1'
  1502.            'map1'
  1503.            'table 1'
  1504.            'X2R'
  1505.  
  1506.    As already announced, there is an exceptional case were localpart and
  1507.    PN are not directly mapped onto each other: sometimes it is necessary
  1508.    to use the localpart for other purposes. If the X.400 address
  1509.    contains attributes that would not allow for the simple mapping:
  1510.  
  1511.  
  1512.  
  1513.  
  1514. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 27]
  1515.  
  1516. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1517.  
  1518.  
  1519.            localpart     <->   PersonalName
  1520.            domainpart    <->   X.400 domain
  1521.  
  1522.    (e.g., spaces are not allowed in an RFC 822 domain, GQ and CN cannot
  1523.    be directly mapped into localpart, DDAs of another type than RFC-
  1524.    822), such attributes, together with the PN, are left-hand-side
  1525.    encoded. The domainpart must still be mapped according to the mapping
  1526.    rule as far as possible. This probably needs some examples:
  1527.  
  1528.            C=nl; ADMD=ade; PRMD=tlec; O=owe; OU=you; S=plork; GQ=jr
  1529.            ->
  1530.            /S=plork/GQ=jr/@you.owe.tlec.nl
  1531.  
  1532.            C=nl; ADMD=ade; PRMD=tlec; O=owe; OU=spc ctr; OU=u; S=plork
  1533.            ->
  1534.            "/S=plork/OU=u/OU=spc ctr/"@owe.tlec.nl
  1535.  
  1536.    Note that in the second example, 'O=owe' is still mapped to a
  1537.    subdomain following the natural hierarchy. The problems start with
  1538.    the space in 'OU=spc ctr'.
  1539.  
  1540. 3.3.2.2.2. RFC 822 -> X.400
  1541.  
  1542.    As an example, assume the following mapping rule is defined:
  1543.  
  1544.            tlec.nl#PRMD$tlec.ADMD$ade.C$nl#
  1545.  
  1546.    Then the address 'plork@owe.you.tlec.nl' :
  1547.  
  1548.            localpart
  1549.               |  sdom3
  1550.               |    | sdom2
  1551.               |    |   |  sdom1
  1552.               |    |   |   |  top-level-domain
  1553.               |    |   |   |   |
  1554.            plork@owe.you.tlec.nl
  1555.  
  1556.    would be mapped as follows.
  1557.  
  1558.    The localpart 'plork' is mapped to 'S=plork', see chapter 3.3.2.1.
  1559.  
  1560.    The domain 'tlec.nl' is mapped according to the mapping rule:
  1561.  
  1562.            S     OU  OU  O  PRMD  ADMD  Country
  1563.            |                |     |    |
  1564.            plork            tlec  ade  nl
  1565.  
  1566.    The remaining domains (owe.you) are mapped one by one following the
  1567.  
  1568.  
  1569.  
  1570. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 28]
  1571.  
  1572. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1573.  
  1574.  
  1575.    natural hierarchy: sdom2 is mapped to O, sdom3 is mapped to OU:
  1576.  
  1577.            S     OU  OU  O  PRMD  ADMD  Country
  1578.            |         |   |  |     |     |
  1579.            plork     |   |  tlec  ade   nl
  1580.                      owe you
  1581.  
  1582.    Thus the mapped address is (in a readable notation):
  1583.  
  1584.            C=nl; ADMD=ade; PRMD=tlec; O=you; OU=owe; S=plork
  1585.  
  1586.    Had there been any left-hand-side encoded SAs in the localpart that
  1587.    didn't represent a complete mnemonic O/R address, the localpart would
  1588.    be mapped to those SAs. E.g.,
  1589.  
  1590.            "/S=plork/GQ=jr/OU=u/OU=spc ctr/"@owe.tlec.nl
  1591.            ->
  1592.            C=nl; ADMD=ade; PRMD=tlec; O=owe; OU=space ctr;
  1593.            OU=u; S=plork; GQ=jr
  1594.  
  1595.    This is necessary to reverse the special use of localpart to left-
  1596.    hand-side encode certain attributes. See 3.3.2.2.1.
  1597.  
  1598.    You might ask yourself by now why such rules are needed at all. Why
  1599.    don't we just use map1 in the other direction? The problem is that a
  1600.    symmetric mapping function (a bijection) would indeed be ideal, but
  1601.    it's not feasible. Asymmetric mappings exist for a number of reasons:
  1602.  
  1603.            - To make sure that uucp addresses etc. get routed over local
  1604.              gateways.
  1605.  
  1606.            - Preferring certain address forms, while still not forbidding
  1607.              others to use another form. Examples of such reasons are:
  1608.  
  1609.                - Phasing out old address forms.
  1610.  
  1611.                - If an RFC 822 address is mapped to ADMD= ; it means that
  1612.                  the X.400 mail can be routed over any ADMD in that
  1613.                  country. One single ADMD may of course send out an
  1614.                  address containing: ADMD=ade; . It must also be possible
  1615.                  to map such an address back.
  1616.  
  1617.    So we do need mapping rules from RFC 822 to X.400 too. The table
  1618.    containing the listing of all such mapping rules, which is
  1619.    distributed to all gateways world-wide, is normally referred to as on
  1620.    which software your are using) are:
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 29]
  1627.  
  1628. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1629.  
  1630.  
  1631.            'rfc2or'
  1632.            'mapping 2'
  1633.            'map2'
  1634.            'table 2'
  1635.            'R2X'
  1636.  
  1637.    If the RFC 822 localpart and/or domainpart contain characters that
  1638.    would not immediately fit in the value of a PN attribute (! % _), the
  1639.    mapping algorithm falls back to DDA mapping. In this case, the SAs
  1640.    that will be used are still determined by mapping the domainpart
  1641.    according to the mapping rule. In our case:
  1642.  
  1643.            100%user@work.tlec.nl
  1644.            ->
  1645.            DD.RFC-822=100(p)user(a)work.tlec.nl;
  1646.            C=nl; ADMD=ade; PRMD=tlec; O=work
  1647.  
  1648.    If no map2 rule can be found, a third table of rules is scanned: the
  1649.    gateway table. This table has the same syntax as mapping table 2, but
  1650.    its semantics are different. First of all, a domain that only has an
  1651.    entry in the gateway table is always mapped into an RFC 822 DDA. For
  1652.    a domain that is purely RFC 822 based, but whose mail may be relayed
  1653.    over an X.400 network, the gateway table associates with such a
  1654.    domain the SAs of the gateway to which the X.400 message should be
  1655.    routed. That gateway will then be responsible for gatewaying the
  1656.    message back into the RFC 822 world. E.g., if we have the gateway
  1657.    table entry:
  1658.  
  1659.            gov#PRMD$gateway.ADMD$Internet.C$us#
  1660.  
  1661.    (and we assume that no overruling map2 rule for the top level domain
  1662.    'gov' exists), this would force all gateways to perform the following
  1663.    mapping:
  1664.  
  1665.            bush@dole.gov
  1666.            ->
  1667.            DD.RFC-822=bush(a)dole.gov;
  1668.            C=us; ADMD=Internet; PRMD=gateway
  1669.  
  1670.    This is very similar to the default DDA mapping, except the SAs are
  1671.    those of a gateway that has declared to be responsible for a certain
  1672.    RFC 822 domain, not those of the local gateway. And thus, this
  1673.    mechanism helps avoid the third party problem discussed in chapter
  1674.    3.2.2.
  1675.  
  1676.    The table containing the listing of all such gateway rules, which is
  1677.    distributed to all gateways world-wide, is normally referred to as
  1678.    the 'gateway table'. Other commonly used filenames (also depending on
  1679.  
  1680.  
  1681.  
  1682. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 30]
  1683.  
  1684. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1685.  
  1686.  
  1687.    which software your are using) are:
  1688.  
  1689.            'rfc1148gate' {From the predecessor of RFC 1327, RFC 1148}
  1690.            'gate table'
  1691.            'GW'
  1692.  
  1693.    Only when no rule at all (map2 or gateway rule) is defined for a
  1694.    domain, the algorithm falls back to the default DDA mapping as
  1695.    described in 3.3.1.2.
  1696.  
  1697. 3.4. Table co-ordination
  1698.  
  1699.    As already stated, the use of mapping tables will only function
  1700.    smoothly if all gateways in the world use the same tables. On the
  1701.    global level, the collection and distribution of RFC 1327 address
  1702.    mapping tables is co-ordinated by the MHS Co-ordination Service:
  1703.  
  1704.           SWITCH Head Office
  1705.           MHS Co-ordination Service
  1706.           Limmatquai 138
  1707.           CH-8001 Zurich, Europe
  1708.           Tel. +41 1 268 1550
  1709.           Fax. +41 1 268 1568
  1710.  
  1711.           RFC 822: project-team@switch.ch
  1712.           X.400:   C=ch;ADMD=arcom;PRMD=switch;O=switch;S=project-team;
  1713.  
  1714.    The procedures for collection and distribution of mapping rules can
  1715.    be found on the MHS Co-ordination Server, in the directory
  1716.    "/procedures".  Appendix D describes how this server can be accessed.
  1717.  
  1718.    If you want to define mapping rules for your own local domain, you
  1719.    can find the right contact person in your country or network (the
  1720.    gateway manager) on the same server, in the directory "/mhs-
  1721.    services".
  1722.  
  1723. 3.5. Local additions
  1724.  
  1725.    Since certain networks want to define rules that should only be used
  1726.    within their networks, such rules should not be distributed world-
  1727.    wide. Consider two networks that both want to reach the old top-
  1728.    level-domain 'arpa' over their local gateway. They would both like to
  1729.    use a mapping 2 rule for this purpose:
  1730.  
  1731.            TLec in NL:     arpa#PRMD$gateway.ADMD$tlec.C$nl#
  1732.  
  1733.            SWITCH in CH:   arpa#PRMD$gateway.ADMD$switch.C$ch#
  1734.  
  1735.  
  1736.  
  1737.  
  1738. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 31]
  1739.  
  1740. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1741.  
  1742.  
  1743.    (You may have noticed correctly that they should have defined such
  1744.    rules in the gateway table, but for the sake of the example, we
  1745.    assume they defined it in mapping table 2. This was the way things
  1746.    were done in the days of RFC 987, and many networks are still doing
  1747.    it this way these days.)
  1748.  
  1749.    Since a mapping table cannot contain two mapping rules with the same
  1750.    domain on the left hand side, such 'local mappings' are not
  1751.    distributed globally. There exists a RARE draft proposal [13] which
  1752.    defines a mechanism for allowing and automatically dealing with
  1753.    conflicting mapping rules, but this mechanism has not been
  1754.    implemented as to date. After having received the global mapping
  1755.    tables from the MHS Co-ordination Service, many networks add 'local'
  1756.    rules to map2 and the gateway table before installing them on their
  1757.    gateways. Note that the reverse mapping 2 rules for such local
  1758.    mappings _are_ globally unique, and can thus be distributed world-
  1759.    wide. This is even necessary, because addresses that were mapped with
  1760.    a local mapping rule may leak out to other networks (here comes the
  1761.    third party problem again...). Such other networks should at least be
  1762.    given the possibility to map the addresses back. So the global
  1763.    mapping table 1 would in this case contain the two rules:
  1764.  
  1765.            PRMD$gateway.ADMD$tlec.C$nl#arpa#
  1766.            PRMD$gateway.ADMD$switch.C$ch#arpa#
  1767.  
  1768.    Note that if such rules would have been defined as local gate table
  1769.    entries instead of map2 entries, there would have been no need to
  1770.    distribute the reverse mappings world-wide (the reverse mapping of a
  1771.    DDA encoded RFC 822 address is simply done by stripping the SAs, see
  1772.    3.3.1.1.).
  1773.  
  1774. 3.6. Product specific formats
  1775.  
  1776.    Not all software uses the RFC 1327 format of the mapping tables
  1777.    internally. Almost all formats allow comments on a line starting with
  1778.    a # sign. Some examples of different formats:
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 32]
  1795.  
  1796. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1797.  
  1798.  
  1799.     RFC 1327
  1800.  
  1801.         # This is pure RFC 1327 format
  1802.         # table 1: X.400 -> RFC 822
  1803.         #
  1804.         PRMD$tlec.ADMD$ade.C$nl#tlec.nl#
  1805.         # etc.
  1806.  
  1807.         # table 2: RFC 822 -> X.400
  1808.         #
  1809.         arcom.ch#ADMD$arcom.C$ch#
  1810.         # etc.
  1811.  
  1812.     EAN
  1813.  
  1814.         # This is EAN format
  1815.         # It uses the readable format for X.400 domains and TABs
  1816.         # to make a 'readable mapping table format'.
  1817.         # table 1: X.400 -> RFC 822
  1818.         #
  1819.         P=tlec; A=ade; C=nl;       # tlec.nl
  1820.         # etc.
  1821.  
  1822.         # table 2: RFC 822 -> X.400
  1823.         #
  1824.         arcom.ch                   # A=arcom; C=ch;
  1825.         # etc.
  1826.  
  1827.     PP
  1828.  
  1829.         # This is PP format
  1830.         # table 1: X.400 -> RFC 822
  1831.         #
  1832.         PRMD$tlec.ADMD$ade.C$nl:tlec.nl
  1833.         # etc.
  1834.  
  1835.         # table 2: RFC 822 -> X.400
  1836.         #
  1837.         arcom.ch:ADMD$arcom.C$ch
  1838.         # etc.
  1839.  
  1840.    Most R&D networks have tools to automatically generate these formats
  1841.    from the original RFC 1327 tables;, some even distribute the tables
  1842.    within their networks in several formats. If you need mapping tables
  1843.    in a specific format, please contact your national or R&D network's
  1844.    gateway manager. See chapter 3.4.
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 33]
  1851.  
  1852. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1853.  
  1854.  
  1855. 3.7. Guidelines for mapping rule definition
  1856.  
  1857.    Beware that defining mapping rules without knowing what you are doing
  1858.    can be disastrous not only for your network, but also for others. You
  1859.    should be rather safe if you follow at least these rules:
  1860.  
  1861.            - First of all, read this tutorial;.
  1862.  
  1863.            - Avoid local mappings; prefer gate table entries. (See chapter
  1864.              3.5)
  1865.  
  1866.            - Make sure any domain you map to can also be mapped back;.
  1867.  
  1868.            - Aim for symmetry.
  1869.  
  1870.            - Don't define a gateway table entry if the same domain already
  1871.              has a map2 entry. Such a rule would be redundant.
  1872.  
  1873.            - Map to "ADMD=0;" if you will not be connected to any ADMD for
  1874.              the time being.
  1875.  
  1876.            - Only map to "ADMD= ;" if you are indeed reachable through
  1877.              _any_ ADMD in your country.
  1878.  
  1879.            - Mind the difference between "PRMD=;" and "PRMD=@;" and make
  1880.              sure which one you need. (Try to avoid empty or unused
  1881.              attributes in the O/R address hierarchy from the beginning!)
  1882.  
  1883.            - Don't define mappings for domains over which you have no
  1884.              naming authority.
  1885.  
  1886.            - Before defining a mapping rule, make sure you have the
  1887.              permission from the naming authority of the domain you want
  1888.              to map to. Normally, this should be the same organisation as
  1889.              the mapping authority of the domain in the left hand side of
  1890.              the mapping rule. This principle is called 'administrative
  1891.              equivalence'.
  1892.  
  1893.            - Avoid redundant mappings. E.g., if all domains under 'tlec.nl'
  1894.              are in your control, don't define:
  1895.  
  1896.                first.tlec.nl#O$first.PRMD$tlec.ADMD$ade.C$nl#
  1897.                last.tlec.nl#O$last.PRMD$tlec.ADMD$ade.C$nl#
  1898.                always.tlec.nl#O$always.PRMD$tlec.ADMD$ade.C$nl#
  1899.  
  1900.              but rather have only one mapping rule:
  1901.  
  1902.                tlec.nl#PRMD$tlec.ADMD$ade.C$nl#
  1903.  
  1904.  
  1905.  
  1906. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 34]
  1907.  
  1908. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1909.  
  1910.  
  1911.  
  1912.            - Before introducing a new mapped version of a domain, make
  1913.              sure the world can route to that mapped domain;.
  1914.  
  1915.              E.g., If you are operating a PRMD: C=zz; ADMD=ade; PRMD=ergo;
  1916.              and you want to define the mapping rules:
  1917.  
  1918.                map1: PRMD$ergo.ADMD$ade.C$zz#ergo.zz#
  1919.                map2: ergo.zz#PRMD$ergo.ADMD$ade.C$zz#
  1920.  
  1921.              Make sure that ergo.zz (or at least all of its subdomains) is
  1922.              DNS routeable (register an MX or A record) and will be routed
  1923.              to a gateway that agreed to route the messages from the
  1924.              Internet to you over X.400.
  1925.  
  1926.              In the other direction, if you are operating the Internet
  1927.              domain cs.woodstock.edu, and you want to define a mapping for
  1928.              that domain:
  1929.  
  1930.                map2: cs.woodstock.edu#O$cs.PRMD$woodstock.ADMD$ .C$us#
  1931.                map1: O$cs.PRMD$woodstock.ADMD$ .C$us#cs.woodstock.edu#
  1932.  
  1933.              Make sure that C=us; ADMD= ; PRMD=woodstock; O=cs; (or at
  1934.              least all of its subdomains) is routeable in the X.400 world,
  1935.              and will be routed to a gateway that agreed to route the
  1936.              messages from X.400 to your RFC 822 domain over SMTP. Within
  1937.              the GO-MHS community, this would be done by registering a
  1938.              line in a so-called domain document, which will state to
  1939.              which mail relay this domain should be routed.
  1940.  
  1941.              Co-ordinate any such actions with your national or MHS'
  1942.              gateway manager. See chapter 3.4.
  1943.  
  1944. 4. Conclusion
  1945.  
  1946.    Mail gatewaying remains a complicated subject. If after reading this
  1947.    tutorial, you feel you understand the basics, try solving some real-
  1948.    life problems. This is indeed a very rewarding area to work in: even
  1949.    after having worked with it for many years, you can make amazing
  1950.    discoveries every other week........
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 35]
  1963.  
  1964. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  1965.  
  1966.  
  1967. Appendix A. References
  1968.  
  1969.    [1]  Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821,
  1970.         USC/Information Sciences Institute, August 1982.
  1971.  
  1972.    [2]  Crocker, D., "Standard for the Format of ARPA Internet Text
  1973.         Messages", STD 11, RFC 822, University of Delaware, August 1982.
  1974.  
  1975.    [3]  Mockapetris, P., "Domain Names - Concepts and Facilities", and
  1976.         "Domain Names - Implementation and Specification", STD 13, RFCs
  1977.         1034 and 1035, USC/Information Sciences Institute, November
  1978.         1987.
  1979.  
  1980.    [4]  Kille, S., "Mapping Between X.400 and RFC 822", RFC 987, UK
  1981.         Academic Community Report (MG.19), UCL, June 1986.
  1982.  
  1983.    [5]  Braden, R., Editor, "Requirements for Internet Hosts --
  1984.         Application and Support", STD 3, RFC 1123, USC/Information
  1985.         Sciences Institute, October 1989.
  1986.  
  1987.    [6]  Postel, J., Editor, "Internet Official Protocol Standards", STD
  1988.         1, RFC 1500, USC/Information Sciences Institute, August 1993.
  1989.  
  1990.    [7]  Chapin, L., Chair, "The Internet Standards Process", RFC 1310,
  1991.         Internet Activities Board, March 1992.
  1992.  
  1993.    [8]  Kille, S., "Mapping between X.400(1988) / ISO 10021 and RFC
  1994.         822", RFC 1327 / RARE RTR 2, University College London, May
  1995.         1992.
  1996.  
  1997.    [9]  Kille, S., "X.400 1988 to 1984 downgrading", RFC 1328 / RARE RTR
  1998.         3, University College London, May 1992.
  1999.  
  2000.    [10] Plattner, B., and H. Lubich, "Electronic Mail Systems and
  2001.         Protocols Overview and Case Study", Proceedings of the IFIP WG
  2002.         6.5 International working conference on message handling systems
  2003.         and distributed applications; Costa Mesa 1988; North-Holland,
  2004.         1989.
  2005.  
  2006.    [11] Houttuin, J., "@route:100%name@address, a practical guide to MHS
  2007.         configuration", Top-Level EC, 1993, (not yet published).
  2008.  
  2009.    [12] Alvestrand, H., "Frequently asked questions on X.400", regularly
  2010.         posted on USEnet in newsgroup comp.protocols.iso.x400.
  2011.  
  2012.    [13] Houttuin, J., Hansen, K., and S. Aumont, "RFC 1327 Address
  2013.         Mapping Authorities", RARE WG-MSG Working Draft, Work in
  2014.         Progress, May 1993.
  2015.  
  2016.  
  2017.  
  2018. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 36]
  2019.  
  2020. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  2021.  
  2022.  
  2023.    [14] "COSINE MHS Pocket User Guide", COSINE MHS Project Team 1992.
  2024.         Also available in several languages from the MHS Co-ordination
  2025.         Server:/user-guides. See Appendix D.
  2026.  
  2027.    [15] Grimm, R., and S. Haug, "A Minimum Profile for RFC 987", GMD,
  2028.         November 1987; RARE MHS Project Team; July 1990. Also available
  2029.         from the MHS Co-ordination Server:/procedures/min-rfc987-
  2030.         profile. See Appendix D.
  2031.  
  2032.    [16] CCITT Recommendations X.400 - X.430. Data Communication
  2033.         Networks: Message Handling Systems.  CCITT Red Book, Vol. VIII -
  2034.         Fasc. VIII.7, Malaga-Torremolinos 1984.
  2035.  
  2036.    [17] CCITT Recommendations X.400 - X.420. Data Communication
  2037.         Networks: Message Handling Systems.  CCITT Blue Book, Vol. VIII
  2038.         - Fasc. VIII.7, Melbourne 1988.
  2039.  
  2040. Appendix B. Index
  2041.  
  2042.    <<Only available in the Postscript version>>
  2043.  
  2044. Appendix C. Abbreviations
  2045.  
  2046.  
  2047.       ADMD     Administration Management Domain
  2048.       ARPA     Advanced Research Projects Agency
  2049.       ASCII    American Standard Code for Information Exchange
  2050.       ASN.1    Abstract Syntax Notation One
  2051.       BCD      Binary-Coded Decimal
  2052.       BITNET   Because It's Time NETwork
  2053.       CCITT    Comite Consultatif International de Telegraphique et
  2054.                Telephonique
  2055.       COSINE   Co-operation for OSI networking in Europe
  2056.       DFN      Deutsches Forschungsnetz
  2057.       DL       Distribution List
  2058.       DNS      Domain Name System
  2059.       DoD      Department of Defense
  2060.       EBCDIC   Extended BCD Interchange Code
  2061.       IAB      Internet Architecture Board
  2062.       IEC      International Electrotechnical Commission
  2063.       IESG     Internet Engineering Steering Group
  2064.       IETF     Internet Engineering Task Force
  2065.       IP       Internet Protocol
  2066.       IPM      Inter-Personal Message
  2067.       IPMS     Inter-Personal Messaging Service
  2068.       IPN      Inter-Personal Notification
  2069.       ISO      International Organisation for Standardisation
  2070.       ISOC     Internet Society
  2071.  
  2072.  
  2073.  
  2074. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 37]
  2075.  
  2076. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  2077.  
  2078.  
  2079.       ISODE    ISO Development Environment
  2080.       JNT      Joint Network Team (UK)
  2081.       JTC      Joint Technical Committee (ISO/IEC)
  2082.       MHS      Message Handling System
  2083.       MOTIS    Message-Oriented Text Interchange Systems
  2084.       MTA      Message Transfer Agent
  2085.       MTL      Message Transfer Layer
  2086.       MTS      Message Transfer System
  2087.       MX       Mail eXchanger
  2088.       OSI      Open Systems Interconnection
  2089.       OU(s)    Organizational Unit(s)
  2090.       PP       Mail gatewaying software (not an abbreviation)
  2091.       PRMD     Private Management Domain
  2092.       RARE     Reseaux Associes pour la Recherche Europeenne
  2093.       RFC      Request for comments
  2094.       RTC      RARE Technical Committee
  2095.       RTR      RARE Technical Report
  2096.       SMTP     simple mail transfer protocol
  2097.       STD      Internet Standard
  2098.       TCP      Transmission Control Protocol
  2099.       UUCP     Unix to Unix CoPy
  2100.  
  2101. Appendix D. How to access the MHS Co-ordination Server
  2102.  
  2103.    Here is an at-a-glance sheet on the access possibilities of the MHS
  2104.    Co-ordination server:
  2105.  
  2106.       E-mail
  2107.  
  2108.         address:
  2109.  
  2110.           RFC822: mhs-server@nic.switch.ch
  2111.           X.400:  S=mhs-server; OU1=nic; O=switch; P=switch; A=arcom;
  2112.                   C=CH
  2113.  
  2114.         body
  2115.  
  2116.           help                       # you receive this document
  2117.           index ['directory']        # you receive a directory listing
  2118.           send 'directory''filename' # you receive the specified file
  2119.  
  2120.       FTP
  2121.  
  2122.         address:  Internet: nic.switch.ch
  2123.         account:  cosine
  2124.         password: 'your email address'
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 38]
  2131.  
  2132. RFC 1506        X.400-Internet Mail Gatewaying Tutorial      August 1993
  2133.  
  2134.  
  2135.       Interactive
  2136.  
  2137.         address:   Internet: nic.switch.ch
  2138.         address:   PSPDN:    +22847971014540
  2139.         address:   EMPB/IXI: 20432840100540
  2140.         account:   info
  2141.         directory: e-mail/COSINE-MHS/
  2142.  
  2143.       FTAM
  2144.  
  2145.         address:  Internet: nic.switch.ch
  2146.         address:  PSPDN   : +22847971014540
  2147.         address:  EMPB/IXI: 20432840100540
  2148.         address:  ISO CLNS: NSAP=39756f11112222223333aa0004000ae100,
  2149.                             TSEL=0103Hex
  2150.         account:  ANON
  2151.  
  2152.       gopher
  2153.  
  2154.         address:  Internet: nic.switch.ch
  2155.  
  2156. Security Considerations
  2157.  
  2158.    Security issues are not discussed in this memo.
  2159.  
  2160. Author's Address
  2161.  
  2162.    Jeroen Houttuin
  2163.    RARE Secretariat
  2164.    Singel 466-468
  2165.    NL-1017 AW Amsterdam
  2166.    Europe
  2167.  
  2168.    Tel. +31 20 6391131
  2169.    Fax. +31 20 6393289
  2170.    RFC 822: houttuin@rare.nl
  2171.    X.400:   C=nl;ADMD=400net;PRMD=surf;O=rare;S=houttuin
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186. RARE Working Group on Mail and Messaging (WG-MSG)              [Page 39]
  2187.  
  2188.